/**
 * Copyright (C) 2010 Cloudfarming <info@cloudfarming.nl>
 *
 * Licensed under the Eclipse Public License - v 1.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *         http://www.eclipse.org/legal/epl-v10.html
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package nl.cloudfarming.client.db;

/**
 * Describes minimal required information about a module with a persistence context.
 * This information is needed by the entityManagerProvider to create an EntityManagerFactory to 
 * provide the EntityManager.
 * 
 * Persisting modules (ie modules with entities and a persistence.xml) should implement this 
 * interface and add the @ServiceProvider(service=PersistingModule.class) annotation
 *
 *
 * @author Timon Veenstra
 */
public interface PersistingModule {


    /**
     * Name of the persistence unit.
     * This should match the name attribute in  <persistence-unit name="persistence_unit" transaction-type="RESOURCE_LOCAL">
     *
     *
     * @return
     */
    String getPersistenceUnit();

    /**
     * Name of the module.
     * Arbitrary String, same string should be used to retrieve an EntityManager from the EntityManagerProvider.getEntityManager()
     *
     * @return
     */
    String getModuleName();
}
